<include file="Public/header" />
<include file="Public/menu" />

<!-- 内容页 -->
<div class="content-wrapper">
    <!-- 面包屑 -->
    <section class="content-header">
        <h1>
            {$title}
            <small>{$title_two}</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> {$title}</a></li>
            <li class="active">{$title_two}</li>
        </ol>
    </section>

    <!-- 内容 -->
    <section class="content">

        <div class="row"><div class="col-md-12"><div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">新增</h3>

                <div class="box-tools">

                    <div class="btn-group pull-right" style="margin-right: 10px">
                        <a href="{:U('Letter/index')}" class="btn btn-sm btn-default"><i class="fa fa-list"></i>&nbsp;返回列表</a>
                    </div>
                </div>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form action="{:U('Letter/addOrSaveLetter')}" method="post" accept-charset="UTF-8" class="form-horizontal" pjax-container="">
                <input type="hidden" name="id" value="{:I('id')}">
                <div class="box-body">

                    <div class="form-group">
                        <label class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-6">
                            <div class="box box-solid box-info no-margin">
                                <select class="form-control" id="dx_type_id" name="slt_id" onchange="showTipInfo(this)">
                                    <foreach name="type_data" item="v1" key="k1" >
                                        <option value="{$k1}" <if condition="$data[slt_id] eq $k1 "> selected = "selected"</if>>{$v1}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">短信模板内容</label>
                        <div class="col-sm-6">
                            <div class="box box-solid box-info no-margin">
                                <textarea class="form-control" rows="3" name="content">{$data[content]}</textarea>
                            </div>
                        </div>
                    </div>
                    <div for="image" class="form-group 1">
                        <label class="col-sm-2 control-label"></label>
                        <div class="col-sm-6 suggest-1" id="parameter-tip" style="margin-left: 0px; color: #da2424; "></div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <div class="col-sm-2">

                    </div>
                    <div class="col-sm-6">

                        <div class="btn-group pull-right">
                            <button type="submit" class="btn btn-info pull-right">提交</button>
                        </div>

                        <div class="btn-group pull-left">
                            <a href="{:U('Letter/index')}" class="btn btn-warning">取消</a>
                        </div>

                    </div>

                </div>
                <!-- /.box-footer -->
            </form>
        </div>

        </div></div>

    </section>
</div>
<!-- 底部 -->
<include file="Public/common_footer" />
<script>
    var parameter_data = {$parameter_data};
    function showTipInfo(o){
        $("#parameter-tip").html(parameter_data[o.value].join("<br/>"));
    }
    $("#parameter-tip").html(parameter_data[$("#dx_type_id").val()].join("<br/>"));


</script>

